program list;

{$APPTYPE CONSOLE}

type
  pelement=^element;
  element=record
    value: integer;
    next: pelement;
  end;
var
  n, i: integer;
  fin: textFile;
  current: pelement;

begin
  assign(fin, 'input.txt');
  reset(fin);
  read(fin, n);
  for i:=0 to n-1 do
  begin
    new(current);
    read(fin,current^.value);
    write(current^.value, ' ');
    current:=current^.next;
    if (i=n-1) then
      current:=nil;
  end;
  readln;
  dispose(current);
end.
